package gvo.newSearch;

import ca.odell.glazedlists.gui.TableFormat;

public class GlazedGVOallTableFormat  implements TableFormat<GlazedGVOall> {

    public int getColumnCount() {
        return 7;
    }
    
    public String getColumnName(int column) {
        if(column == 0)      return "IdBuch";
        else if(column == 1) return "Signatur";
        else if(column == 2) return "Titel";
        else if(column == 3) return "Autoren";
        else if(column == 4) return "Stichworte";
        else if(column == 5) return "Notiz";
        else if(column == 6) return "Ort/Jahr";

        throw new IllegalStateException();
    }
    
    public Object getColumnValue(GlazedGVOall gl, int column) {

        if(column == 0)      return gl.getIdBuch();
        else if(column == 1) return gl.getSignatur();
        else if(column == 2) return gl.getTitel();
        else if(column == 3) return gl.getAutoren();
        else if(column == 4) return gl.getStichworte();
        else if(column == 5) return gl.getNotiz();
        else if(column == 6) return gl.getOrtJahr();

        throw new IllegalStateException();
    }

}
